package com.jzo2o.customer.controller.operation;


import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 机构认证审核表 前端控制器
 * </p>
 *
 * @author wei
 * @since 2025-01-18
 */

@Api(tags = "审核 - 审核机构")
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("/operation/agency-certification-audit")
public class AgencyCertificationAuditController {
    @Autowired
    private IAgencyCertificationAuditService agencyCertificationAuditService;

    @GetMapping("/page")
    public PageResult<AgencyCertificationAuditResDTO> page(AgencyCertificationAuditPageQueryReqDTO reqDTO){
        return agencyCertificationAuditService.page(reqDTO);
    }

    @PutMapping("/audit/{id}")
    public void audit (@PathVariable("id") Long id,
                       @RequestParam("rejectReason") String rejectReason,
                       @RequestParam("certificationStatus") Integer certificationStatus
    ) {
        agencyCertificationAuditService.audit (id,rejectReason,certificationStatus);

    }
}
